/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sn.gandal.mobile.kalpet.persistence;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * @version V 1.0 01/03/2010
 * @author SOWDIOMYERO
 */
@Entity
@Table(name = "partenaire_pcb", catalog = "kmobile", schema = "", uniqueConstraints = {
    @UniqueConstraint(columnNames = {"cni"})})
@NamedQueries({
    @NamedQuery(name = "PartenairePcb.findAll", query = "SELECT p FROM PartenairePcb p"),
    @NamedQuery(name = "PartenairePcb.findById", query = "SELECT p FROM PartenairePcb p WHERE p.id = :id"),
    @NamedQuery(name = "PartenairePcb.findByContrat", query = "SELECT p FROM PartenairePcb p WHERE p.contrat = :contrat"),
    @NamedQuery(name = "PartenairePcb.findByDateInscription", query = "SELECT p FROM PartenairePcb p WHERE p.dateInscription = :dateInscription"),
    @NamedQuery(name = "PartenairePcb.findByType", query = "SELECT p FROM PartenairePcb p WHERE p.type = :type"),
    @NamedQuery(name = "PartenairePcb.findByAdresse", query = "SELECT p FROM PartenairePcb p WHERE p.adresse = :adresse"),
    @NamedQuery(name = "PartenairePcb.findByTelephone", query = "SELECT p FROM PartenairePcb p WHERE p.telephone = :telephone"),
    @NamedQuery(name = "PartenairePcb.findByComptes", query = "SELECT p FROM PartenairePcb p WHERE p.comptes = :comptes"),
    @NamedQuery(name = "PartenairePcb.findByCni", query = "SELECT p FROM PartenairePcb p WHERE p.cni = :cni")})
public class PartenairePcb implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Column(name = "contrat")
    private Integer contrat;
    @Basic(optional = false)
    @Column(name = "dateInscription", nullable = false, length = 6)
    private String dateInscription;
    @Basic(optional = false)
    @Column(name = "type", nullable = false, length = 3)
    private String type;
    @Basic(optional = false)
    @Column(name = "adresse", nullable = false, length = 50)
    private String adresse;
    @Basic(optional = false)
    @Column(name = "telephone", nullable = false)
    private int telephone;
    @Column(name = "comptes")
    private Integer comptes;
    @Column(name = "cni", length = 20)
    private String cni;

    public PartenairePcb() {
    }

    public PartenairePcb(Integer id) {
        this.id = id;
    }

    public PartenairePcb(Integer id, String dateInscription, String type, String adresse, int telephone) {
        this.id = id;
        this.dateInscription = dateInscription;
        this.type = type;
        this.adresse = adresse;
        this.telephone = telephone;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getContrat() {
        return contrat;
    }

    public void setContrat(Integer contrat) {
        this.contrat = contrat;
    }

    public String getDateInscription() {
        return dateInscription;
    }

    public void setDateInscription(String dateInscription) {
        this.dateInscription = dateInscription;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public int getTelephone() {
        return telephone;
    }

    public void setTelephone(int telephone) {
        this.telephone = telephone;
    }

    public Integer getComptes() {
        return comptes;
    }

    public void setComptes(Integer comptes) {
        this.comptes = comptes;
    }

    public String getCni() {
        return cni;
    }

    public void setCni(String cni) {
        this.cni = cni;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PartenairePcb)) {
            return false;
        }
        PartenairePcb other = (PartenairePcb) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sn.gandal.mobile.kalpet.persistence.PartenairePcb[id=" + id + "]";
    }

}
